package com.foreknow.dao;

import com.foreknow.entity.Department;
import com.foreknow.entity.DepartmentList;
import com.foreknow.entity.DepartmentModel;
import com.foreknow.entity.Deptcategoryid;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DepartmentMapper {

    /**
     * 根据ID删除
     * @param id
     * @return
     */
    int updateByPrimaryKey(Integer id);

    /**
     * 新增Department
     * @param record
     * @return
     */
    int insert(Department record);

    /**
     * 根据ID查询
     * @param id
     * @return
     */
    DepartmentModel selectByPrimaryKey(Integer id);

    /**
     * 查询全部
     * @return
     */
    List<DepartmentModel> SelectDepartmentAll();

    /**
     * 查询模糊缩写
     * @param name
     * @return
     */
    List<DepartmentModel> departmentFuzzyByName(String condition,String name);

    /**
     * 查询模糊名称
     * @param name
     * @return
     */
    List<DepartmentModel> departmentFuzzyByNames(String name);

    /**
     * 根据修改
     * @param record
     * @return
     */
    int updateByPrimaryKeySelective(Department record);

    /**
     * 查询科室列表
     * @return
     */
    List<Deptcategoryid> SelectDeptcategoryid();

    /**
     * 查询科室明细列表 /**重写
     * @return
     */
    List<DepartmentList> SelectDepartmentList(Integer id);

    /**
     * 根据ID查询DPName
     * @param id
     * @return
     */
    @Select("select * from department where id = #{id}")
    Department selectById(Integer id);

    /**
     * 全部
     * @return
     */
    @Select("select * from department ")
    List<Department> DPlist();




}